package com.handa.admin.staticFiles.controller;


import com.handa.admin.staticFiles.entity.StaticFileCategory;
import com.handa.admin.staticFiles.service.IStaticFileCategoryService;
import com.handa.admin.userservice.common.entity.Response;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Comparator;
import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author author
 * @since 2025-08-26
 */
@RestController
@RequestMapping("/Admin/staticFiles/static-file-category")
public class StaticFileCategoryController {
    @Resource
    private IStaticFileCategoryService staticFileCategoryService;

    @GetMapping("getAll")
    public Response<?> getAll() {
        List<StaticFileCategory> list = staticFileCategoryService.list();
        List<StaticFileCategory> res = list.stream().sorted(Comparator.comparing(StaticFileCategory::getId)).toList();
        return Response.success(res);
    }


}

